<?php

namespace App\Http\Resources\base;

use Illuminate\Http\Resources\Json\Resource;

class PageResource extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {

        return  [
            'items'        => $this->resource->items(),
            'total'        => $this->resource->total(),
            'perPage'      => $this->resource->perPage(),
            'current_page' => $this->resource->currentPage()
        ];

    }
}
